<?php
	namespace Annoubas\BaseBundle\Entity;
	
	use Doctrine\ORM\Mapping as ORM;
	use Symfony\Component\Validator\Constraints as Assert;
	
	/**
	 * @ORM\Entity
	 */
	
	class SubRubs {
		/**
		 * @ORM\GeneratedValue(strategy="AUTO")
		 * @ORM\Id
		 * @ORM\Column(type="integer")
		 */
		private $idsr;
		
		/**
		 * @ORM\Column(type="string", length="255")
		 * @Assert\NotBlank()
		 * @Assert\MinLength(3)
		 */
		private $name;
		
		/**
        * @ORM\ManyToOne(targetEntity="Rubs", inversedBy="SubRubs")
        * @ORM\JoinColumn(name="rub", referencedColumnName="idr")
        */
        protected $rub;
        
        /**
        * @ORM\OneToMany(targetEntity="Orgs", mappedBy="SubRubs")
        */
        protected $orgs;
    
    
    public function __construct()
    {
        $this->orgs = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Get idsr
     *
     * @return integer 
     */
    public function getIdsr()
    {
        return $this->idsr;
    }

    /**
     * Set name
     *
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set rub
     *
     * @param Annoubas\BaseBundle\Entity\Rubs $rub
     */
    public function setRub(\Annoubas\BaseBundle\Entity\Rubs $rub)
    {
        $this->rub = $rub;
    }

    /**
     * Get rub
     *
     * @return Annoubas\BaseBundle\Entity\Rubs 
     */
    public function getRub()
    {
        return $this->rub;
    }

    /**
     * Add orgs
     *
     * @param Annoubas\BaseBundle\Entity\Orgs $orgs
     */
    public function addOrgs(\Annoubas\BaseBundle\Entity\Orgs $orgs)
    {
        $this->orgs[] = $orgs;
    }

    /**
     * Get orgs
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getOrgs()
    {
        return $this->orgs;
    }
}